package cn.tedu._07springaop.aop;

import org.springframework.stereotype.Component;

@Component
public class CalculatorImpl implements Calculator{
    @Override
    public int add(int x, int y) {
        if(x<0){
            throw new  IllegalArgumentException("参数不能大与零");
        }
        System.out.println( x+y);
        return x+y;
    }

    @Override
    public int sud(int x, int y) {
        return x-y;
    }

    @Override
    public int mul(int x, int y) {
        return x*y;
    }

    @Override
    public int div(int x, int y) {
        return x/y;
    }
}
